//
//  YLHealthKitModel.h
//  HealthKitManager
//
//  Created by JuneLee on 2018/11/9.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSUInteger, SleepType) {
    SleepTypeInBed = 0,//卧床
    SleepTypeAsleep = 1,//睡眠
    SleepTypeAwake = 2,//清醒
};

NS_ASSUME_NONNULL_BEGIN
@class YLHealthKitModel;

// 健康数据配置项
@interface YLHealthKitConfig : NSObject

@property (nonatomic, strong) NSString *userId;

@property (nonatomic, strong) NSArray<YLHealthKitModel *> *healthArray;

@end


@interface YLHealthKitModel : NSObject

/** 时间 */
@property (nonatomic, strong) NSDate *date;
/** 身高 单位：米 */
@property (nonatomic, assign) CGFloat height;
/** 体重 单位：克 */
@property (nonatomic, assign) CGFloat weight;
/** 去脂体重 单位：克 */
@property (nonatomic, assign) CGFloat fatWeight;
/** 体脂率 单位：0 ~ 1 */
@property (nonatomic, assign) CGFloat bodyFat;
/** bmi */
@property (nonatomic, assign) CGFloat bmi;
/** bmr */
@property (nonatomic, assign) CGFloat bmr;

/** 开始时间(一般是运动步数，睡眠，心率有的) */
@property (nonatomic, strong) NSDate *startDate;
/** 结束时间 */
@property (nonatomic, strong) NSDate *endDate;
/** 步数 */
@property (nonatomic, assign) int step;
/** 睡眠类型 */
@property (nonatomic, assign) SleepType sleepType;
/** 心率值 */
@property (nonatomic, assign) int heartRate;
/** 距离 */
@property (nonatomic, assign) int distance;

/** 秤的数据初始化 */
- (YLHealthKitModel *)initHeight:(CGFloat)height weight:(CGFloat)weight fatWeight:(CGFloat)fatWeight bodyFat:(CGFloat)bodyFat bmi:(CGFloat)bmi bmr:(CGFloat)bmr date:(NSDate *)date;

/** 步数初始化 */
- (YLHealthKitModel *)initStep:(int)step startDate:(NSDate *)startDate endDate:(NSDate *)endDate;

/** 睡眠初始化 */
- (YLHealthKitModel *)initSleepType:(SleepType)sleepType startDate:(NSDate *)startDate endDate:(NSDate *)endDate;

/** 心率初始化 */
- (YLHealthKitModel *)initheartRate:(int)heartRate startDate:(NSDate *)startDate endDate:(NSDate *)endDate;

@end

NS_ASSUME_NONNULL_END
